package com.pacy.pacybaseproject.activitys;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;

import com.blankj.utilcode.util.FragmentUtils;
import com.flyco.tablayout.listener.CustomTabEntity;
import com.flyco.tablayout.listener.OnTabSelectListener;
import com.fondesa.recyclerviewdivider.DividerBuilder;
import com.pacy.pacybaseproject.BR;
import com.pacy.pacybaseproject.R;
import com.pacy.pacybaseproject.base.BaseXActivity;
import com.pacy.pacybaseproject.beans.TabBean;
import com.pacy.pacybaseproject.databinding.ActivityRedempPointsBinding;
import com.pacy.pacybaseproject.viewmodels.RedempPointsViewModel;

import java.util.ArrayList;

/**
 * 积分兑换列表
 */
public class RedempPointsActivity extends BaseXActivity<ActivityRedempPointsBinding, RedempPointsViewModel> {
    private ArrayList<CustomTabEntity> tabs = new ArrayList<>();
    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_redemp_points;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        super.initData();
        setToolbar(binding.baseToolBar);
        if (binding.recyclerView.getItemDecorationCount() == 0) {
            new DividerBuilder(RedempPointsActivity.this)
                    .size(15, TypedValue.COMPLEX_UNIT_DIP)
                    .color(Color.TRANSPARENT)
                    .showFirstDivider()
                    .showLastDivider()
                    .build().addTo(binding.recyclerView);
        }
        initTab();
    }

    private void initTab(){
        tabs.add(new TabBean("全部"));
        tabs.add(new TabBean("特色"));
        tabs.add(new TabBean("出行"));
        tabs.add(new TabBean("文化"));
        tabs.add(new TabBean("旅游"));
        binding.tabLayout.setTabData(tabs);
        binding.tabLayout.setCurrentTab(0);
        binding.tabLayout.setOnTabSelectListener(new OnTabSelectListener() {
            @Override
            public void onTabSelect(int position) {
            }

            @Override
            public void onTabReselect(int position) {

            }
        });
    }
}